package ldh.im.fxbase.data.pojo;

import ldh.rpc.util.JsonUtil;

public class MessageExt {

    private Boolean remote;      // 否：本地上传的文件。 是： 远程下载的文件
    private String fileUrl;
    private String fileName;
    private String originalName; // 原始文件名称
    private String md5;          // 文件MD5
    private Long size;           // 文件长度
    private Integer imageWidth;  // 图片的宽度
    private Integer imageHeight; // 图片的高度
    private Integer time;        // 视频文件长度（单位：秒)

    public Boolean getRemote() {
        return remote;
    }

    public void setRemote(Boolean remote) {
        this.remote = remote;
    }

    public String getFileUrl() {
        return fileUrl;
    }

    public void setFileUrl(String fileUrl) {
        this.fileUrl = fileUrl;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public Long getSize() {
        return size;
    }

    public void setSize(Long size) {
        this.size = size;
    }

    public String toString() {
        return JsonUtil.toJson(this);
    }

    public Integer getTime() {
        return time;
    }

    public void setTime(Integer time) {
        this.time = time;
    }

    public String getOriginalName() {
        return originalName;
    }

    public void setOriginalName(String originalName) {
        this.originalName = originalName;
    }

    public String getMd5() {
        return md5;
    }

    public void setMd5(String md5) {
        this.md5 = md5;
    }

    public Integer getImageWidth() {
        return imageWidth;
    }

    public void setImageWidth(Integer imageWidth) {
        this.imageWidth = imageWidth;
    }

    public Integer getImageHeight() {
        return imageHeight;
    }

    public void setImageHeight(Integer imageHeight) {
        this.imageHeight = imageHeight;
    }

    public void setImageSize(int[] size) {
        if (size == null) return;
        if (size.length != 2) throw new IllegalArgumentException("图片尺寸有误");
        this.imageWidth = size[0];
        this.imageHeight = size[1];
    }
}
